home *** CD-ROM | disk | FTP | other *** search
/ Colson Caster Selection Guide 3 / Colson Caster Selection Guide 3.0.iso / data1.cab / Program_Executable_Files / colsoncd.dxr / Intro_27_bopen.ls < prev    next >
Encoding:
Text File  |  2000-01-12  |  1.5 KB  |  43 lines

  1. on mouseUp
  2.   put EMPTY into field "masterfield"
  3.   set theText to "temp"
  4.   if objectp(myFile) then
  5.     set myFile to 0
  6.   end if
  7.   set myFile to new(xtra("fileio"))
  8.   setFilterMask(myFile, "All files, *.*,Text files, *.txt")
  9.   set fileName to displayOpen(myFile)
  10.   if not voidp(fileName) and not (fileName = EMPTY) then
  11.     openFile(myFile, fileName, 1)
  12.     set teststatus to status(myFile)
  13.     if teststatus = 0 then
  14.       set theFile to readFile(myFile)
  15.       put theFile into field "masterfield"
  16.     else
  17.       alert(error(myFile, status(myFile)))
  18.     end if
  19.   end if
  20.   closeFile(myFile)
  21.   set myFile to 0
  22.   put EMPTY into field "orderfield"
  23.   put EMPTY into field "detail"
  24.   if the number of items in line 1 of field "masterfield" < 16 then
  25.     alert(" You've imported the wrong file type. You must import a file that was saved using the Colson CD-ROM Catalog!")
  26.     put " " into field "masterfield"
  27.     abort()
  28.   end if
  29.   repeat with i = 1 to the number of lines in field "masterfield"
  30.     if the number of chars in line i of field "masterfield" < 2 then
  31.       exit repeat
  32.     end if
  33.     put item 16 of line i of field "masterfield" & "   " after field "orderfield"
  34.     put item 2 of line i of field "masterfield" & " " after field "orderfield"
  35.     put item 1 of line i of field "masterfield" & RETURN after field "orderfield"
  36.     set the textStyle of field "orderfield" to "Plain"
  37.     set the textFont of field "orderfield" to "Courier New"
  38.     set the textSize of field "orderfield" to 12
  39.   end repeat
  40.   set the keyDownScript to "whichkey"
  41.   go("orderarea")
  42. end
  43.